<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>管理员列表</title>
    <link rel="stylesheet" href="styles/style.css" type="text/css" media="all">
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/common.js"></script>
</head>
<body>
<?php
header("content-type:text/html;charset=utf-8");
include "Mysql/MySqlClass.php";
$mySQL = new Ycf\Lession\MySqlClass\MySqlClass('jinling_company', 'root', '123456');

$adminNo = $_POST['adminNo'];
$sql     = implode(" , ", $adminNo);
$sql     = "id in($sql)";
$mySQL->delete("admin", '', $sql);
$admin = ($mySQL->select("admin"));
?>
<div class="container">
    <div class="hastabmenu">
        <ul class="tabmenu">
            <li id="adduserbtn" class="tabcurrent"><a href="#" >添加管理员</a></li>
        </ul>
        <form action="mysqlOption/adminInsert.php" method="post">
        <div id="adduserdiv" class="tabcontentcur">
            <table width="100%">
                <tbody>
                <tr>
                    <td>用户名:</td>
                    <td><input name="username" class="txt" type="text"></td>
                    <td>密码:</td>
                    <td><input name="password" class="txt" type="password"></td>
                    <td><input value="提 交" class="btn" type="submit"></td>
                </tr>
                </tbody>
            </table>
            </form>
        </div>
    </div>
    <br>
    <h3>管理员列表</h3>
    <div class="mainbox">
        <form action=""method="post">
        <table class="datalist fixwidth">
            <tbody>
            <?php foreach ($admin as $value) {;?>
            <tr>
                <td class="option">
                    <input name="adminNo[]"  value="<?php echo $value['id']; ?>" class="checkbox" type="checkbox">
                </td>
                <td><strong><?php echo $value['adminName']; ?></strong></td>
                <td><?php echo $value['adminEnrollDate']; ?></td>
                <td><?php echo $value['adminEnrollIp']; ?></td>
                <td><?php if ($value['adminState'] == 1) {echo '启用';}
    ;?>
                <td><a href="userEdit.php?userId=<?php echo $value['id']; ?>">编辑</a></td></td>
            </tr>
<?php }
?>
            <tr class="nobg">
                <td><input value="提 交" class="btn" type="submit"></td>
                <td class="tdpage" colspan="6">
                    <div class="pages">
                        <em>100</em>
                        <strong>1</strong>
                        <a href="">2</a>
                        <a href="">3</a>
                        <a href="">4</a>
                        <a href="" class="next">&rsaquo;&rsaquo;</a>
                        <a href="" class="last">... </a>
                        <kbd><input type="text" name="custompage" size="3" onkeydown="if(event.keyCode==13) {window.location='?page='+this.value; return false;}" /></kbd>
                    </div>
                </td>
            </tr>
            </tbody>
        </table>
        </form>
    </div>
</div>
</body>
</html>
